<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
        String basePath = "http://" + request.getLocalAddr() + ":" + request.getLocalPort() + request.getContextPath();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
    <title>${promptInfo.totalDescInfo}</title>
    <head>
		<script type="text/javascript">
				function dictionaryValidate(obj){
					var dicTypeValue = obj.value;
					if(dicTypeValue==''){
						return false;
					}
					var splitName = dicTypeValue.split(" ");
					if(splitName.length > 1){
						alert("类别名称，不允许有空格，请重新填写！");
				    	var titleObj = obj;
				    	titleObj.focus();
						return false;
						}
			        var url = 'ajaxAction.action';
			        var pars = 'command=list'
				        +'&defaultSqlID=test|dictionary.select_one_by_value&paramMap.value='+dicTypeValue;
			        var myAjax = new Ajax.Request(
			        url, 
			        {
			            method: 'post', 
			            parameters:  pars,
			            onComplete: responseHandler,
			            asynchronous:false
			        });
					}	
				function responseHandler(request)
				{  
				    var resJsonData = request.responseText.evalJSON();  
				    var datas = resJsonData.datas;
				    if(datas.length>0){
				    	alert("该类别名称已存在，请重新填写！");
				    	var titleObj = $("value");
				    	titleObj.value="";
				    	titleObj.focus();
				    }		
				}	 
		</script>
    </head>
    <body>
        <form name="actionForm" method="post" action="operateAction.action" id="actionForm" onsubmit="return Validator.Validate(this,3);">
            <input type="hidden" value="name" name="logColumn" /> <input type="hidden" value="true" name="islog" />
            <input type="hidden" name="code" value="${code}">
            <input type="hidden" name="paramMap.key" value="${paramMap.key}">
            <input type="hidden" name="imitateStep" value="1">
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableT">
                <tr>
                    <td class="tableTleft">&nbsp;</td>
                    <td class="tableTcenter">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td width="46%" valign="middle">
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                        <tr>
                                            <td width="5%">
                                                <div align="center"><img src="<%=request.getContextPath()%>/images/default/tab/tb.gif"></div>
                                            </td>
                                            <td width="95%" class="tableTBig">${promptInfo.contentDescInfo}--以下带<font color="red">*</font>为必填选项</td>
                                        </tr>
                                    </table>
                                </td>
                                <td width="54%">&nbsp;</td>
                            </tr>
                        </table>
                    </td>
                    <td class="tableTright">&nbsp;</td>
                </tr>
            </table>
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableC">
                <tr>
                    <td class="tableCleft">&nbsp;</td>
                    <td class="tableCcenter">
                        <table width="100%" border="0" cellpadding="0" cellspacing="1" class="SkyTDLine">
                            <tr>
                                <td class="SkyTDLine">
                                    <table class="SkyTDLine" cellSpacing="1" cellPadding="0" width="100%" border="0">
                                        <tr class="MeNewTDLine" align="center">
                                            <td align="left">
                                                <table class="Ntable" cellSpacing="1" cellPadding="0"
                                                       width="100%" border="0">
                                                    <tr class="MeNewTDLine">
                                                        <td align="right" class="SkyTDLine" width="10%">类别别名：&nbsp;</td>
                                                        <td class="SkyTDLine">&nbsp;
																<input name="paramMap.value" type="text" maxlength="20" id="value"
                                                                   value="${initMap.dictionaryInfo[0].value}"
                                                                   readonly
                                                                   style="width:200;"/>
																&nbsp;<font color="red">*</font>
                                                        </td>
                                                    </tr>
                                                    <tr class="MeNewTDLine">
                                                        <td align="right" class="SkyTDLine" width="10%">类别名称：&nbsp;</td>
                                                        <td class="SkyTDLine">&nbsp;
                                                            <input name="paramMap.alias" type="text" maxlength="20" id="alias"
                                                                   value="${initMap.dictionaryInfo[0].alias}"
                                                                   dataType="Custom" regexp="^[A-Za-z0-9\u0391-\uFFE5]+$" msg="类别名称只能由汉字、英文字母、阿拉伯数字组成，长度为20。"
                                                                   style="width:200;"/>&nbsp;<font color="red">*</font>
                                                        </td>
                                                    </tr>
                                                    <tr class="MeNewTDLine">
                                                        <td align="right" class="SkyTDLine">类别描述：&nbsp;</td>
                                                        <td class="SkyTDLine">&nbsp;
                                                            <input name="paramMap.description"
                                                                   value="${initMap.dictionaryInfo[0].description}"
                                                                   type="text" maxlength="200" id="description" style="width:200;"/>
                                                        </td>
                                                    </tr>
                                                    <tr class="MeNewTDLine" align="center">
                                                        <td colSpan="2" class="SkyTDLine"><div align="center">注:以上带 <span class="STYLE1"><font color="red">*</font></span>为必填选项 </div></td>
                                                    </tr>
                                                    <tr class="MeNewTDLine" align="center">
                                                        <td colSpan="2" class="SkyTDLine"><input
                                                                type="submit" name="BtnOk" value="修改" id="BtnOk"
                                                                class="SkyButtonBlur"
                                                                onMouseOut="this.className='SkyButtonBlur'"
                                                                onMouseOver="this.className='SkyButtonFocus'"/>&nbsp;&nbsp;<input
                                                                type="button" name="BtnOk" value="返回" id="BtnOk"
                                                                class="SkyButtonBlur"
                                                                onMouseOut="this.className='SkyButtonBlur'"
                                                                onMouseOver="this.className='SkyButtonFocus'"
                                                                onclick="window.history.back();" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td class="tableCright">&nbsp;</td>
                </tr>
            </table>
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableF">
                <tr>
                    <td class="tableFleft">&nbsp;</td>
                    <td class="tableFcenter">&nbsp;</td>
                    <td class="tableFright">&nbsp;</td>
                </tr>
            </table>
            <table width="100%" height="100" border="0" cellpadding="0" cellspacing="0" class="tablemain">
                <tr>
                    <td>
                        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableT">
                            <tr>
                                <td class="tableTleft">&nbsp;</td>
                                <td class="tableTcenter">
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                        <tr>
                                            <td width="46%" valign="middle">
                                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                    <tr>
                                                        <td width="5%">
                                                            <div align="center"><img src="<%=request.getContextPath()%>/images/default/tab/tb.gif"></div>
                                                        </td>
                                                        <td width="95%" class="tableTBig">帮助说明</td>
                                                    </tr>
                                                </table>
                                            </td>
                                            <td width="54%">&nbsp;</td>
                                        </tr>
                                    </table>
                                </td>
                                <td class="tableTright">&nbsp;</td>
                            </tr>
                        </table>
                        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableC">
                            <tr>
                                <td class="tableCleft">&nbsp;</td>
                                <td class="tableCcenter">
                                    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableC">
                                        <tr>
                                            
                                            <td class="tableCcenter">
                                                <table width="100%" border="0" cellpadding="0" cellspacing="1" class="SkyTDLine">
                                                    <tr>
                                                        <td class="SkyTDLine">${promptInfo.helpDescInfo}</td>
                                                    </tr>
                                                </table>
                                           </td>
                                            
                                        </tr>
                                    </table>
                                </td>
                                <td class="tableCright">&nbsp;</td>
                            </tr>
                        </table>
                        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableF">
                            <tr>
                                <td class="tableFleft">&nbsp;</td>
                                <td class="tableFcenter">&nbsp;</td>
                                <td class="tableFright">&nbsp;</td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </form>
    </body>
</html>